@extends('layouts.buz.layout', ['header_active' => 'channel'])
@section('assets')

@endsection()
@section('title')
    支付通道
@endsection()
@section('full-content')



    <div class="yhy-content col-sm-8 col-xs-10 bgwhite" style="float: inherit;margin: 0 auto;">
        {{--<input type="hidden" id="app_id" value="{{$id}}">--}}

        <div class="panel panel-default">
            <div class="panel-heading">
                <h4 class="panel-title">
                    支付通道
                </h4>
            </div>
            <div class="panel-body">
                <table class="table table-striped table-bordered y-mt10">
                    <thead>
                    <tr>
                        <th>产品</th>
                        <th>费率</th>
                        <th>结算周期(d+)</th>
                        <th>通道状态</th>
                    </tr>
                    </thead>
                    <tbody id="tableList">

                    </tbody>
                </table>
            </div>
        </div>

    </div>

@endsection()

@section('dialog')


@endsection()
@section('bottom_js')
    <script src="{{asset('js/buz/template-web.js')}}"></script>
    <script id="list" type="text/html">
        @{{each data.payments  value }}
            <tr>
            <td>@{{value.name}}</td>
            <td>@{{value.rate}}</td>
            <td>@{{value.settle_cycle}}</td>
            <td>
                @{{ if value.status == 0 }}
                <button class="btn btn-sm btn-danger">关闭</button>
                @{{ else }}
                <button class="btn btn-sm btn-success">正常</button>
                @{{ /if }}
            </td>
        </tr>
        @{{/each}}
        @{{ if data.length <=0 }}
        <tr class="no-records-found"><td colspan="3">没有找到匹配的记录</td></tr>
        @{{ /if }}
    </script>
    <script>
        $.ajax({
            url: "/api/profile/payments",
            type: 'get',
            success:function(data){
                if(filterAjaxData(data)){

                    var html = template('list', data);
                    document.getElementById('tableList').innerHTML = html;
                }
            }
//            complete: function () {
//                $(".yhy-loading").remove();
//            }


        });
    </script>

@endsection()
